set -x
video_path=demo_video.mov
sample_rate=0
images_folder_path=images_tmp

if [ $sample_rate = 0 ]; then
    echo "sampe rate is 0"
    ffmpeg -i $video_path -qscale:v 2 images/frame%05d.jpg
else
    ffmpeg -i $video_path -r $sample_rate -qscale:v 2 images/frame%05d.jpg
fi